/*
 * @Author: 段本显
 * @FilePath: \my-vue-app\vite.config.ts
 * @Date: 2021-12-29 19:58:41
 * @LastEditors: 段本显
 * @LastEditTime: 2022-01-04 11:55:50
 * @Email: duanbenxian@jianq.com
 * 如果有bug，那肯定不是我的锅，噜噜噜
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import ViteRestart from 'vite-plugin-restart'
import Components from 'unplugin-vue-components/vite'
import { VantResolver } from 'unplugin-vue-components/resolvers'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    Components({
      resolvers: [VantResolver()],
    }),
    ViteRestart({
      restart: ['vite.config.[jt]s'],
    }),
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'),
    },
  },
  server: {
    host: '0.0.0.0',
  },
})
